<template>
  <div>
    {{ counterStore.counter }}
    <div v-for="(item, index) in userList" :key="index">
      <el-checkbox
        label="重命名"
        @change="changeVal(item)"
        v-model="item.rename"
        :true-value="1"
        :false-value="0"
      ></el-checkbox>
      <el-checkbox
        label="刷新"
        @change="changeVal(item)"
        v-model="item.refresh"
        :true-value="1"
        :false-value="0"
      ></el-checkbox>
      <el-checkbox
        label="编辑"
        @change="changeVal(item)"
        v-model="item.edit"
        :true-value="1"
        :false-value="0"
      ></el-checkbox>
    </div>
  </div>
</template>

<script lang="ts" setup>
import useCounterStore from '../../store/counter'
import { ref } from 'vue'
let checkList = ref([])
function chanegVal() {
  console.log(checkList.value)
}
let authorityList = ref([
  {
    id: 1,
    label: '编辑'
  },
  {
    id: 1,
    label: '重命名'
  },
  {
    id: 1,
    label: '刷新'
  }
])

let userList = ref([
  {
    id: 1,
    rename: 1,
    refresh: 1
  },
  {
    id: 1,

    edit: 0,
    rename: 1,
    refresh: 1
  },
  {
    id: 1,
    edit: 0,
    rename: 1,
    refresh: 0
  }
])

function changeVal(val: any) {
  console.log(val)
}

const counterStore = useCounterStore()
</script>
``

<style lang="scss" scoped></style>
